//生成右表
function initRighTable() {
	var html = '<table class="table table-bordered text-nowrap table-condensed" id="randomtable1">';
	console.log(rightlist);
	html += '<caption id="captions">随机抽签结果</caption>';
	html += '<th style="width:100px">' + "序号" + '</th>';
	html += '<th style="width:150px">' + "考场号" + '</th>';
	html += '<th>' + "科目1" + '</th>';
	html += '<th>' + "科目2" + '</th>';
	html += '<th>' + "科目3" + '</th>';
	html += '<th>' + "科目4" + '</th>';
	html += '<th>' + "地点" + '</th>';
	html += '<th>' + "监考员甲" + '</th>';
	html += '<th>' + "监考员乙" + '</th>';

	var mark = 0;
	for (var j in rightlist) {
		if (!(('序号') in rightlist[j]) || !(('考场号') in rightlist[j]) || !(('科目1') in rightlist[j]) ||
			!(('科目2') in rightlist[j]) || !(('科目3') in rightlist[j]) || !(('科目4') in rightlist[j]) || !(('地点') in rightlist[j])) {
			swal("数据有误,请保证数据准确");
			mark = 1;
			$('#randomtable1').remove();
			$('#randomtable2').remove();
		} else {
			html += '<tr id="' + (parseInt(j) + 1) + '">';
			html += '<td class="modality" >' + rightlist[j]['序号'] + '</td>';
			html += '<td class="modality">' + rightlist[j]['考场号'] + '</td>';
			html += '<td class="modality">' + rightlist[j]['科目1'] + '</td>';
			html += '<td class="modality">' + rightlist[j]['科目2'] + '</td>';
			html += '<td class="modality">' + rightlist[j]['科目3'] + '</td>';
			html += '<td class="modality">' + rightlist[j]['科目4'] + '</td>';
			html += '<td class="modality">' + rightlist[j]['地点'] + '</td>';
			html += '<td ></td>';
			html += '<td ></td>';
			html += '</tr>'
		}
	}

	html += '</table>';
	if (mark != 1) {
		$('#treeRightList').append(html);
	}
	
	var html = '<table class="table table-bordered table-condensed" id="randomtable2">';

	html += '<caption id="captions">随机备用监考</caption>'


	html += '</table>';
	if (mark != 1) {
		$('#treeRightList').append(html);
	}

}
